A shared memory multicore processor has been conventionally known that includes one physical memory and CPUs, respectively connected to the memory (hereinafter, “shared memory”) via a bus, etc., (hereinafter, “multicore processor system”). In the multicore processor system, a main OS determines the application software (hereinafter, “application”) to be assigned to the CPUs using a scheduler (see, e.g., Japanese Laid-Open Patent Publication Nos. 2003-6170, H10-240698, H8-153023, and 2007-18268).
In the multicore processor system of the shared memory type, each of the CPUs accesses the shared memory and consequently, access contention occurs. Therefore, the multicore processor system includes an arbiter circuit that arbitrates the access by the CPUs to prevent the access contention.
Three access arbitration schemes are known, including a round-robin scheme, a weighted round-robin scheme, and a priority level control scheme. The arbiter circuit sequentially extracts access requests from a request buffer that has access requests registered therein, and permits access. Access ratios are determined using an arbitrary scheme selected from among the three schemes and the arbiter circuit arbitrates the access requests by controlling the order of registration of the access requests into the request buffer according to the access ratios. An “access ratio” is a ratio of the access periods given to the cores. For the ease of understanding, description will be given assuming that all the necessary access periods of the access requests are equivalent.
The three schemes will be described in detail taking an example of a case where the arbiter circuit is notified of an access request from an app “A” (application “A”) assigned to a given CPU and another access request from an app “B” (application “B”) assigned to another CPU different from the given CPU.
According to the round-robin scheme, time slices are set that are the access periods of the processor cores and this scheme evenly gives the processor cores rights to access a shared resource. For example, assuming that the access ratio of the app A to the app B is 1:1 and a time slice is the required access period indicated in each access request, the access requests of the apps A and B are alternately registered into the request buffer. The access ratio of the app A to the app B is the ratio of the access period of the access right given to the CPU to which the app A is assigned to the access period of the access right given to the CPU to which the app B is assigned.
According to the weighted round-robin scheme, it is assumed that the access ratio of the app A to the app B is the priority level of the app A:the priority level of the app B. For example, when the priority level of the app A is 90 and the priority level of the app B is 80, the access ratio of the app A to the app B is 9:8. Assuming that the time slice is the required access period indicated in each access request, eight access requests from the app B are registered for every nine access requests from the app A are registered.
According to the priority level control scheme, when the priority level of the app A is equal to or higher than the priority level of the app B, the request buffer sets the access ratio of the app A to the app B to be “the largest registration number that can be registered:1”. It is assumed in this description that the largest registration number is nine. Assuming that the request buffer can register nine access requests as above and the time slice is the required access period indicated in each access request, one access request from the app B is registered for every nine access requests from the app A.
Although the optimal arbitration scheme among the three arbitration schemes changes depending on the combination of the applications assigned, the arbitration scheme is fixed in the arbiter circuit to any one of the three schemes. In a case where the round-robin scheme is employed, when an application whose priority level is high and another application whose priority level is low are assigned to the CPUs, a problem arises in that the application whose priority level is high cannot be given preference because the access ratios are fixed to 1:1.
When the priority level control scheme is employed, access by an application whose priority level is high can be terminated early while another application whose priority level is low must stand by until access is permitted. Therefore, a problem arises in that, when an application whose priority level is low, accesses the shared resource a large number of times, the period that this application stands by increases and the processing of the application whose priority level is low is slowed down.
In a case where the weighted round-robin scheme is employed, even for two applications whose priority levels are equivalent, when the number of accesses by one application is large and that of the other application is small, a problem arises in that the period that the one application stands by increases and the processing of the one application is slowed down.
The access ratios are fixed in the arbiter circuit and therefore, a problem arises in response to the access ratios depending on the combination of the applications assigned to the CPUs.